package com.yxuan.springboot.mapper;

import com.yxuan.springboot.model.AllProfessional;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 
 * @author zchao
 *    AllProfessionalMapper层
 * @date 2023-05-18 20:19:29
 */
@Mapper
public interface AllProfessionalMapper extends BaseMapper<AllProfessional> {
    // 查询专业大类
    @Select("SELECT id,major_type majorType FROM `all_professional` where education_level = #{education_level} GROUP BY major_type")
    List<AllProfessional> getMajorType(@Param("education_level") String educationLevel);

    // 查询专业细分类别
    @Select("SELECT id,major_type majorType,major_detail_type majorDetailType,name FROM `all_professional` where major_type=#{major_type}  group by major_detail_type ORDER BY id desc")
    List<AllProfessional> getMajorDetailType(@Param("major_type") String majorType);

    @Select("SELECT id,major_type majorType,major_detail_type majorDetailType,name,study_length studyLength FROM `all_professional` where major_detail_type=#{major_detail_type} and education_level = #{education_level} ORDER BY id desc")
    List<AllProfessional> getProfessionalByType(@Param("major_detail_type") String majorDetailType,@Param("education_level")  String education_level);

    List<AllProfessional> queryTotalSpeBySchoolID(@Param("schoolID") Long schoolID);

    List<AllProfessional> queryTotalProBySchoolID(@Param("schoolID") Long schoolID);

    List<AllProfessional> queryTotalProByUserID(@Param("userID") Integer userID);

    List<AllProfessional> queryTotalProConThree();
}
